package com.me.libgdx_test;

import java.util.ArrayList;

public class ClassPermanentUpgrades {
	private ClassLogDisplay logger;
	ArrayList<ClassDungeonShop> permanent_shops;
	ClassPermanentUpgrades(ClassDungeonShop[] game_shops){
		logger = new ClassLogDisplay("ClassPermanentUpgrades");
		permanent_shops = new ArrayList<ClassDungeonShop>();
		for(ClassDungeonShop game_shop:game_shops){
			if(!game_shop.actual_shop && game_shop.upgradeable){
				permanent_shops.add(game_shop);
			}
		}
	}
	public int add_gold(ClassDungeonPickup object){
		for(ClassDungeonShop permanent_shop:permanent_shops){
			if(permanent_shop.Name.contains("Mining")){
				if(object.Name.equals("Gold")){
					int extra_gold = 4;
					//This is put here so that things are easier to unlock in the store, without it being too easy
					return permanent_shop.tech_level + extra_gold;
				}
			}
		}
		return 0;
	}
	/*public int add_gold_value(){
		for(ClassDungeonShop permanent_shop:permanent_shops){
			if(permanent_shop.Name == "Refining"){
				return permanent_shop.tech_level;
			}
		}
		return 0;
	}
	public int starting_health_mana_increase(){
		for(ClassDungeonShop permanent_shop:permanent_shops){
			if(permanent_shop.Name == "Ritual"){
				return permanent_shop.tech_level;
			}
		}
		return 0;
	}
	public float potion_effect_increase(){
		for(ClassDungeonShop permanent_shop:permanent_shops){
			if(permanent_shop.Name == "Medicine"){
				return .05f * (float)permanent_shop.tech_level;
			}
		}
		return 0;
	}*/
	public float get_upgrade_value(String upgrade){
		logger.print("Looking for: " + upgrade);
		for(ClassDungeonShop permanent_shop:permanent_shops){
			logger.print("Checking: " + permanent_shop.Name);
			if(upgrade.equals("Refining") && permanent_shop.Name.contains("Refining")){
				return permanent_shop.tech_level;
			}
			if(upgrade.equals("Ritual") && permanent_shop.Name.contains("Ritual")){
				return permanent_shop.tech_level;
			}
			if(upgrade.equals("Medicine") && permanent_shop.Name.contains("Medicine")){
				return .05f * (float)permanent_shop.tech_level;
			}
			if(upgrade.equals("Barter") && permanent_shop.Name.contains("Barter")){
				return .05f * (float)permanent_shop.tech_level;
			}
			if(upgrade.equals("Cities") && permanent_shop.Name.contains("Cities")){
				return permanent_shop.tech_level;
			}
			if(upgrade.equals("Religion") && permanent_shop.Name.contains("Religion")){
				return .05f * (float)permanent_shop.tech_level;
			}
		}
		return 0;
	}
	
/*
 * 		//shop_holder.add(new ClassDungeonShop("Mining","loc_shop","upgrade_mining.png","Gold Piles Increase","",techPrefixes,get_unlock_at_id(11),false));
 *		//shop_holder.add(new ClassDungeonShop("Refining","loc_shop","upgrade_refining.png","Gold Value Increase","",techPrefixes,get_unlock_at_id(12),false));
 *		//shop_holder.add(new ClassDungeonShop("Medicine","loc_shop","upgrade_medicine.png","Potions Effectiveness Increase","",techPrefixes,get_unlock_at_id(13),false));
 *		//shop_holder.add(new ClassDungeonShop("Barter","loc_shop","upgrade_barter.png","Shop Discount Increase","",techPrefixes,get_unlock_at_id(14),false));
 *		//shop_holder.add(new ClassDungeonShop("Cities","loc_shop","upgrade_cities.png","Shop/Altar Frequency Increase","",techPrefixes,get_unlock_at_id(15),false));
 *		//shop_holder.add(new ClassDungeonShop("Religion","loc_shop","upgrade_religion.png","Available Gods Increase","",techPrefixes,get_unlock_at_id(16),false));
 *		//shop_holder.add(new ClassDungeonShop("Ritual","loc_shop","upgrade_ritual.png","Starting HP/MP Increase","",techPrefixes,get_unlock_at_id(17),false));
 */
}
